package co.edu.usbcali.adt.exercises.market.v1;

import java.util.ArrayList;
import java.util.List;

public class ShoppingCart {
	
	private long id;
	List<String> products=new ArrayList<String>();
	private long total;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public List<String> getProducts() {
		return products;
	}
	public void setProducts(List<String> products) {
		this.products = products;
	}
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public boolean addProduct(String product){
		return products.add(product);
	}
	public int size(){
		return products.size();
	}
	public String toString()
	{
		String ret="";
		for (String code : products) {
			ret+=code+" ";
		}
		return "ShoppingCart:"+id+" items:"+ret+" total:"+total;
	}
	

}
